package com.xcesys.extras.remoting.lookup;

import java.util.Collection;

import javax.jws.WebParam;
import javax.jws.WebService;

import com.xcesys.extras.dataobject.lookup.ValueLabelItem;

/**
 * 基本数据检索Web Service，通常为下拉列表等UI控件提供数据检索服务。
 * 
 * @author Danne
 * 
 */
@WebService(targetNamespace = "com.xcesys.extras.remoting.lookup", serviceName = "LookupService")
public interface RLookupService {

	/**
	 * Returns lookup object data presented as CodeNameItem with given class
	 * name and code parameters.
	 * 
	 * @param type
	 *            lookup object type name.
	 * @param code
	 *            lookup object unique code.
	 * @param conditionValues
	 *            additional condition values.
	 * @return lookup object data as {@link ValueLabelItem}.
	 */
	public ValueLabelItem findObjectByCode(
			@WebParam(name = "type") String type,
			@WebParam(name = "code") String code,
			@WebParam(name = "conditionValues") Object[] conditionValues);

	/**
	 * @param type
	 *            lookup object type name.
	 * @param id
	 * @param conditionValues
	 *            additional condition values.
	 * @return
	 */
	public ValueLabelItem findObjectById(@WebParam(name = "type") String type,
			@WebParam(name = "id") Long id,
			@WebParam(name = "conditionValues") Object[] conditionValues);

	/**
	 * Returns all lookup objects data presented as CodeNameItem with given
	 * class name, code, name parameters.
	 * 
	 * @param type
	 *            lookup object class name.
	 * @param code
	 *            lookup object field value presented as code.
	 * @param label
	 *            lookup object field value presented as display label.
	 * 
	 * @return lookup object data as {@link ValueLabelItem}.
	 */
	public Collection<ValueLabelItem> findObjectsByCodeLabel(
			@WebParam(name = "type") String type,
			@WebParam(name = "code") String code,
			@WebParam(name = "label") String label);

	/**
	 * Returns all lookup objects data presented as CodeNameItem with given
	 * class name, code, name parameters.
	 * 
	 * @param type
	 *            lookup object class name.
	 * @param code
	 *            lookup object field value presented as code.
	 * @param label
	 *            lookup object field value presented as display label.
	 * @param conditionValues
	 *            additional condition values for searching.
	 * @return lookup object data as {@link ValueLabelItem}.
	 */
	public Collection<ValueLabelItem> findObjectsByCondition(
			@WebParam(name = "type") String type,
			@WebParam(name = "code") String code,
			@WebParam(name = "label") String label,
			@WebParam(name = "conditionValues") Object[] conditionValues);

}
